package com.stxx.assistant.controller;

import cn.hutool.core.lang.UUID;
import com.stxx.assistant.domain.SysTask;
import com.stxx.assistant.framwork.domain.R;
import com.stxx.assistant.framwork.domain.model.PageQuery;
import com.stxx.assistant.framwork.domain.model.PageResult;
import com.stxx.assistant.service.SysTaskService;
import org.noear.solon.annotation.*;

import java.sql.SQLException;
import java.util.Date;

/**
 * @author Fuzhenlei
 * @date 2025/01/17 9:37
 */
@Controller
@Mapping("/task")
public class TaskController {
    @Inject
    SysTaskService taskService;




    @Get
    @Mapping("/list")
    public PageResult<SysTask> taskList(@Body SysTask bo,PageQuery query) throws SQLException {
        return taskService.pageList(bo,query);
    }

    @Delete
    @Mapping("")
    public R<Integer> taskList(Date endTime) throws SQLException {
        int i= taskService.deleteBefore(endTime);
        return R.ok("删除成功",i);
    }


}
